import java.util.Scanner;

import static javafx.application.Platform.exit;

public class TeacherMenu {
    Scanner in = new Scanner(System.in);

    public TeacherMenu(String user) {
        this.menu(user);
    }

    public void menu(String user){
        boolean flag = true;
        while(flag){
            TeacherFile teacherFile = new TeacherFile();
            StudentFile studentFile = new StudentFile();
            System.out.println("=======欢迎进入教师系统=======");
            System.out.println("—————————请输入功能——————————");
            System.out.println("1.修改密码");
            System.out.println("2.查看个人信息");
            System.out.println("3.录入学生信息");
            System.out.println("4.查找学生信息");
            System.out.println("5.查看所有学生信息");
            System.out.println("6.更新学生信息");
            System.out.println("其他：退出教师系统");
            System.out.println("---------------------------");
            String num = in.next();
            switch(num){
                case "1":teacherFile.updatePwd(user);break;
                case "2":teacherFile.printself(user);break;
                case "3":teacherFile.input();break;
                case "4":teacherFile.findone();break;
                case "5":teacherFile.printallStudent();break;
                case "6":teacherFile.updateStudent();break;
                default:flag=false;
            }
        }


    }
}
